<%--
  Created by IntelliJ IDEA.
  User: dllo
  Date: 18/3/1
  Time: 下午8:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>

    <meta charset="UTF-8">

    <title>登录</title>

    <link rel="stylesheet" href="../css/style.css" media="screen" type="text/css" />

    <script src="../js/modernizr.js"></script>

</head>

<body>

<form method="post" action="#">
    <input name="name" placeholder="请输入账号..." class="name" required type="text"/>
    <input name="psw" placeholder="请输入密码..." class="message" type="password" required />
    <input name="submit" class="btn" type="button" value="登录" />
</form>
<div style="text-align:center;clear:both">
    <script src="/gg_bd_ad_720x90.js" type="text/javascript"></script>
    <script src="/follow.js" type="text/javascript"></script>
</div>
<script src='../js/jquery.js'></script>
<script src="../js/jquery-3.2.1.js"></script>
<script>

    $(document).keypress(function(e) {
        // 回车键事件
        if(e.which == 13) {
            jQuery(".btn").click();
        }
    });
    $(".btn").click(function () {
        $.ajax({
            url: "/dologin",
            data: {
                name: $(".name").val(),
                pwd: $(".message").val(),
            },
            success: function (result) {
                console.log(result)
                alert(result.message)
                if (result.code == "1") {
                    window.location.href = "/userlist"
                }
            }
        })
    })
</script>

</body>

</html>
